SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.DnnProduct_GetPortalSpaceUsed
	@PortalID int
AS

SELECT 'SpaceUsed' = SUM(CAST(Size as bigint))
FROM   DnnProduct_Files
WHERE  ((PortalId = @PortalID) OR (@PortalID is null and PortalId is null))


GO
